<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: BreakpointPathlossModel Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00039.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">BreakpointPathlossModel Class Reference<div class="ingroups"><a class="el" href="a00511.html">analogueModels - AnalogueModel implementations</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="BreakpointPathlossModel" --><!-- doxytag: inherits="AnalogueModel" -->
<p>Basic implementation of a <a class="el" href="a00039.html" title="Basic implementation of a BreakpointPathlossModel. This class can be used to implement the ieee802154...">BreakpointPathlossModel</a>. This class can be used to implement the ieee802154 path loss model.  
 <a href="a00039.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00395_source.html">BreakpointPathlossModel.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for BreakpointPathlossModel:</div>
<div class="dyncontent">
<div class="center"><img src="a00621.png" border="0" usemap="#BreakpointPathlossModel_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for BreakpointPathlossModel:</div>
<div class="dyncontent">
<div class="center"><img src="a00622.png" border="0" usemap="#BreakpointPathlossModel_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00623.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a75f814ce2e0a9c22764a6821848c3153">BreakpointPathlossModel</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the analogue model. playgroundSize need to be valid as long as this instance exists.  <a href="#a75f814ce2e0a9c22764a6821848c3153"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#ad3082c9473bc2e4f973b565268f37ce0">initFromMap</a> (const <a class="el" href="a00009.html#ab1820eb5285a02a2464be54ec651feab">ParameterMap</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the analog model from XML map data.  <a href="#ad3082c9473bc2e4f973b565268f37ce0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a6e8f40d451a398c981c5039da397b4db">filterSignal</a> (airframe_ptr_t, const <a class="el" href="a00065.html">Coord</a> &amp;, const <a class="el" href="a00065.html">Coord</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Filters a specified AirFrame's <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> by adding an attenuation over time to the <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>.  <a href="#a6e8f40d451a398c981c5039da397b4db"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a40f8c0d27eba086bc3a2f6f65af1f37c"></a><!-- doxytag: member="BreakpointPathlossModel::isActiveAtDestination" ref="a40f8c0d27eba086bc3a2f6f65af1f37c" args="()" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>isActiveAtDestination</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1f36f2c1056bc9365838cc0d89d5e441"></a><!-- doxytag: member="BreakpointPathlossModel::isActiveAtOrigin" ref="a1f36f2c1056bc9365838cc0d89d5e441" args="()" -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>isActiveAtOrigin</b> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d">PL01</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Model to use for distances below breakpoint distance.  <a href="#aaf5084c5a5dc83b37a468e5813a8191d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a31580babd35b18cbd87a7ac30b71693f"></a><!-- doxytag: member="BreakpointPathlossModel::PL02" ref="a31580babd35b18cbd87a7ac30b71693f" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>PL02</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abaedae8f705d49e1c7fc547eede38c62"></a><!-- doxytag: member="BreakpointPathlossModel::PL01_real" ref="abaedae8f705d49e1c7fc547eede38c62" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62">PL01_real</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">initial path loss <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea3fe4a5fdc2aead5a651791b07688d3"></a><!-- doxytag: member="BreakpointPathlossModel::PL02_real" ref="aea3fe4a5fdc2aead5a651791b07688d3" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>PL02_real</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9308bf633a9048ae42b7b004d718606f"></a><!-- doxytag: member="BreakpointPathlossModel::alpha1" ref="a9308bf633a9048ae42b7b004d718606f" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a9308bf633a9048ae42b7b004d718606f">alpha1</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">pathloss exponents <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab2b41fdd2300b115a75c9647a7cd7e9b"></a><!-- doxytag: member="BreakpointPathlossModel::alpha2" ref="ab2b41fdd2300b115a75c9647a7cd7e9b" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>alpha2</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f5df99a4fac21e39f985b8af0d9412c"></a><!-- doxytag: member="BreakpointPathlossModel::breakpointDistance" ref="a8f5df99a4fac21e39f985b8af0d9412c" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c">breakpointDistance</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Breakpoint distance squared. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15f631e677b586706c16f910187c5b69"></a><!-- doxytag: member="BreakpointPathlossModel::carrierFrequency" ref="a15f631e677b586706c16f910187c5b69" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a15f631e677b586706c16f910187c5b69">carrierFrequency</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Carrier frequency in Hz. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4ce233223157fbad4767ee989d0328c"></a><!-- doxytag: member="BreakpointPathlossModel::useTorus" ref="ae4ce233223157fbad4767ee989d0328c" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#ae4ce233223157fbad4767ee989d0328c">useTorus</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Information needed about the playground. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab46183c9afd261db6972087e706dd736"></a><!-- doxytag: member="BreakpointPathlossModel::playgroundSize" ref="ab46183c9afd261db6972087e706dd736" args="" -->
<a class="el" href="a00065.html">Coord</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#ab46183c9afd261db6972087e706dd736">playgroundSize</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the playground. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa9f8dbeb8e7e0f3a9200652d1f81a88c"></a><!-- doxytag: member="BreakpointPathlossModel::debug" ref="aa9f8dbeb8e7e0f3a9200652d1f81a88c" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c">debug</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Whether debug messages should be displayed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">cOutVector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00039.html#a0c6ce678120579025519343c8a0974c3">pathlosses</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Basic implementation of a <a class="el" href="a00039.html" title="Basic implementation of a BreakpointPathlossModel. This class can be used to implement the ieee802154...">BreakpointPathlossModel</a>. This class can be used to implement the ieee802154 path loss model. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a75f814ce2e0a9c22764a6821848c3153"></a><!-- doxytag: member="BreakpointPathlossModel::BreakpointPathlossModel" ref="a75f814ce2e0a9c22764a6821848c3153" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">BreakpointPathlossModel::BreakpointPathlossModel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes the analogue model. playgroundSize need to be valid as long as this instance exists. </p>
<p>The constructor needs some specific knowledge in order to create its mapping properly:</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">alpha</td><td>the coefficient alpha (specified e.g. in config.xml and passed in constructor call) </td></tr>
    <tr><td class="paramname">carrierFrequency</td><td>the carrier frequency </td></tr>
    <tr><td class="paramname">useTorus</td><td>information about the playground the host is moving in </td></tr>
    <tr><td class="paramname">playgroundSize</td><td>information about the playground the host is moving in </td></tr>
    <tr><td class="paramname">debug</td><td>display debug messages? </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><pre class="fragment">    : <a class="code" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a>()
    , <a class="code" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d" title="Model to use for distances below breakpoint distance.">PL01</a>(0)
    , PL02(0)
    , <a class="code" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62" title="initial path loss">PL01_real</a>(0)
    , PL02_real(0)
    , <a class="code" href="a00039.html#a9308bf633a9048ae42b7b004d718606f" title="pathloss exponents">alpha1</a>(<a class="code" href="a00039.html#a9308bf633a9048ae42b7b004d718606f" title="pathloss exponents">alpha1</a>)
    , alpha2(alpha2)
    , <a class="code" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c" title="Breakpoint distance squared.">breakpointDistance</a>(<a class="code" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c" title="Breakpoint distance squared.">breakpointDistance</a>)
    , <a class="code" href="a00039.html#a15f631e677b586706c16f910187c5b69" title="Carrier frequency in Hz.">carrierFrequency</a>(<a class="code" href="a00039.html#a15f631e677b586706c16f910187c5b69" title="Carrier frequency in Hz.">carrierFrequency</a>)
    , <a class="code" href="a00039.html#ae4ce233223157fbad4767ee989d0328c" title="Information needed about the playground.">useTorus</a>(<a class="code" href="a00039.html#ae4ce233223157fbad4767ee989d0328c" title="Information needed about the playground.">useTorus</a>)
    , <a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>(<a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>)
    , <a class="code" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c" title="Whether debug messages should be displayed.">debug</a>(<a class="code" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c" title="Whether debug messages should be displayed.">debug</a>)
    , <a class="code" href="a00039.html#a0c6ce678120579025519343c8a0974c3">pathlosses</a>()
  {
    <a class="code" href="a00039.html#a0c6ce678120579025519343c8a0974c3">pathlosses</a>.setName(<span class="stringliteral">&quot;pathlosses&quot;</span>);
  }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6e8f40d451a398c981c5039da397b4db"></a><!-- doxytag: member="BreakpointPathlossModel::filterSignal" ref="a6e8f40d451a398c981c5039da397b4db" args="(airframe_ptr_t, const Coord &amp;, const Coord &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void BreakpointPathlossModel::filterSignal </td>
          <td>(</td>
          <td class="paramtype">airframe_ptr_t&#160;</td>
          <td class="paramname"><em>frame</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00065.html">Coord</a> &amp;&#160;</td>
          <td class="paramname"><em>sendersPos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00065.html">Coord</a> &amp;&#160;</td>
          <td class="paramname"><em>receiverPos</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Filters a specified AirFrame's <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a> by adding an attenuation over time to the <a class="el" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>. </p>
<p>Calculate the distance factor </p>

<p>Implements <a class="el" href="a00009.html#a3242bc36a68dab53551d4ab1f1dab010">AnalogueModel</a>.</p>

<p>References <a class="el" href="a00192.html#a0beeef0f27c33145a0fca521df1c5f5c">Signal::addAttenuation()</a>, <a class="el" href="a00039.html#a9308bf633a9048ae42b7b004d718606f">alpha1</a>, <a class="el" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c">breakpointDistance</a>, <a class="el" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c">debug</a>, <a class="el" href="a00039.html#a0c6ce678120579025519343c8a0974c3">pathlosses</a>, <a class="el" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62">PL01_real</a>, <a class="el" href="a00039.html#ab46183c9afd261db6972087e706dd736">playgroundSize</a>, <a class="el" href="a00212.html#a453ce64062fa7afd7398735a9cf499a6">TimeMapping&lt; Interpolator &gt;::setValue()</a>, <a class="el" href="a00065.html#a9245e5acb794d95128e191e6faef99d4">Coord::sqrdist()</a>, <a class="el" href="a00065.html#aaf6119bf8bc9953d561729314de8ed5e">Coord::sqrTorusDist()</a>, and <a class="el" href="a00039.html#ae4ce233223157fbad4767ee989d0328c">useTorus</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                                                  {
  <a class="code" href="a00192.html" title="The signal class stores the physical representation of the signal of an AirFrame.">Signal</a>&amp; signal = frame-&gt;getSignal();

  <span class="keywordtype">double</span> distance = <a class="code" href="a00039.html#ae4ce233223157fbad4767ee989d0328c" title="Information needed about the playground.">useTorus</a> ? receiverPos.<a class="code" href="a00065.html#aaf6119bf8bc9953d561729314de8ed5e" title="Returns the squared distance on a torus of this to Coord &#39;b&#39; (omits calling square root)...">sqrTorusDist</a>(sendersPos, <a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>)
                  : receiverPos.<a class="code" href="a00065.html#a9245e5acb794d95128e191e6faef99d4" title="Returns distance^2 to Coord &#39;a&#39; (omits calling square root).">sqrdist</a>(sendersPos);
  distance = sqrt(distance);
  debugEV &lt;&lt; <span class="stringliteral">&quot;distance is: &quot;</span> &lt;&lt; distance &lt;&lt; endl;

  <span class="keywordflow">if</span>(distance &lt;= 1.0) {
    <span class="comment">//attenuation is negligible</span>
    <span class="keywordflow">return</span>;
  }

  <span class="keywordtype">double</span> attenuation = 1;
  <span class="comment">// PL(d) = PL0 + 10 alpha log10 (d/d0)</span>
  <span class="comment">// 10 ^ { PL(d)/10 } = 10 ^{PL0 + 10 alpha log10 (d/d0)}/10</span>
  <span class="comment">// 10 ^ { PL(d)/10 } = 10 ^ PL0/10 * 10 ^ { 10 log10 (d/d0)^alpha }/10</span>
  <span class="comment">// 10 ^ { PL(d)/10 } = 10 ^ PL0/10 * 10 ^ { log10 (d/d0)^alpha }</span>
  <span class="comment">// 10 ^ { PL(d)/10 } = 10 ^ PL0/10 * (d/d0)^alpha</span>
  <span class="keywordflow">if</span>(distance &lt; <a class="code" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c" title="Breakpoint distance squared.">breakpointDistance</a>) {
    attenuation = attenuation * <a class="code" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62" title="initial path loss">PL01_real</a>;
    attenuation = attenuation * pow(distance, <a class="code" href="a00039.html#a9308bf633a9048ae42b7b004d718606f" title="pathloss exponents">alpha1</a>);
  } <span class="keywordflow">else</span> {
    attenuation = attenuation * PL02_real;
    attenuation = attenuation * pow(distance/<a class="code" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c" title="Breakpoint distance squared.">breakpointDistance</a>, alpha2);
  }
  attenuation = 1/attenuation;
  debugEV &lt;&lt; <span class="stringliteral">&quot;attenuation is: &quot;</span> &lt;&lt; attenuation &lt;&lt; endl;

  <span class="keywordflow">if</span>(<a class="code" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c" title="Whether debug messages should be displayed.">debug</a>) {
    <a class="code" href="a00039.html#a0c6ce678120579025519343c8a0974c3">pathlosses</a>.record(10*log10(attenuation)); <span class="comment">// in dB</span>
  }

  <span class="comment">//const DimensionSet&amp; domain = DimensionSet::timeDomain;</span>
  <a class="code" href="a00013.html" title="Defines an argument for a mapping.">Argument</a> arg; <span class="comment">// default constructor initializes with a single dimension, time, and value 0 (offset from signal start)</span>
  <a class="code" href="a00212.html">TimeMapping&lt;Linear&gt;</a>* attMapping = <span class="keyword">new</span> <a class="code" href="a00212.html">TimeMapping&lt;Linear&gt;</a> (); <span class="comment">// mapping performs a linear interpolation from our single point -&gt; constant</span>
  attMapping-&gt;<a class="code" href="a00212.html#a453ce64062fa7afd7398735a9cf499a6" title="Changes the value of the function at the specified position.">setValue</a>(arg, attenuation);

  <span class="comment">/* at last add the created attenuation mapping to the signal */</span>
  signal.<a class="code" href="a00192.html#a0beeef0f27c33145a0fca521df1c5f5c" title="Adds a function representing an attenuation of the signal.">addAttenuation</a>(attMapping);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ad3082c9473bc2e4f973b565268f37ce0"></a><!-- doxytag: member="BreakpointPathlossModel::initFromMap" ref="ad3082c9473bc2e4f973b565268f37ce0" args="(const ParameterMap &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool BreakpointPathlossModel::initFromMap </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00009.html#ab1820eb5285a02a2464be54ec651feab">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize the analog model from XML map data. </p>
<p>This method should be defined for generic analog model initialization.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">params</td><td>The parameter map which was filled by XML reader.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the initialization was successfully. </dd></dl>

<p>Reimplemented from <a class="el" href="a00009.html#a9c52493cdf1baa4110a83869e8bc13c5">AnalogueModel</a>.</p>

<p>References <a class="el" href="a00039.html#a9308bf633a9048ae42b7b004d718606f">alpha1</a>, <a class="el" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c">breakpointDistance</a>, <a class="el" href="a00039.html#a15f631e677b586706c16f910187c5b69">carrierFrequency</a>, <a class="el" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c">debug</a>, <a class="el" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d">PL01</a>, <a class="el" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62">PL01_real</a>, <a class="el" href="a00039.html#ab46183c9afd261db6972087e706dd736">playgroundSize</a>, and <a class="el" href="a00039.html#ae4ce233223157fbad4767ee989d0328c">useTorus</a>.</p>
<div class="fragment"><pre class="fragment">                                                                    {
    ParameterMap::const_iterator it;
    <span class="keywordtype">bool</span>                         bInitSuccess = <span class="keyword">true</span>;

    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;seed&quot;</span>)) != params.end()) {
        srand( ParameterMap::mapped_type(it-&gt;second).longValue() );
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;alpha1&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#a9308bf633a9048ae42b7b004d718606f" title="pathloss exponents">alpha1</a> = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No alpha1 defined in config.xml for BreakpointPathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;alpha2&quot;</span>)) != params.end()) {
        alpha2 = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No alpha1 defined in config.xml for BreakpointPathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;L01&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d" title="Model to use for distances below breakpoint distance.">PL01</a>      = ParameterMap::mapped_type(it-&gt;second).doubleValue();
        <a class="code" href="a00039.html#abaedae8f705d49e1c7fc547eede38c62" title="initial path loss">PL01_real</a> = pow(10, <a class="code" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d" title="Model to use for distances below breakpoint distance.">PL01</a>/10);
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No L01 defined in config.xml for BreakpointPathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;L02&quot;</span>)) != params.end()) {
        PL02      = ParameterMap::mapped_type(it-&gt;second).doubleValue();
        PL02_real = pow(10, PL02/10);
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No L02 defined in config.xml for BreakpointPathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;breakpointDistance&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#a8f5df99a4fac21e39f985b8af0d9412c" title="Breakpoint distance squared.">breakpointDistance</a> = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No breakpointDistance defined in config.xml for BreakpointPathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;useTorus&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#ae4ce233223157fbad4767ee989d0328c" title="Information needed about the playground.">useTorus</a> = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No useTorus defined in config.xml for SimplePathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;PgsX&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>.x = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No PgsX defined in config.xml for SimplePathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;PgsY&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>.y = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No PgsY defined in config.xml for SimplePathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;PgsZ&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#ab46183c9afd261db6972087e706dd736" title="The size of the playground.">playgroundSize</a>.z = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No PgsZ defined in config.xml for SimplePathlossModel!&quot;</span>);
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;debug&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c" title="Whether debug messages should be displayed.">debug</a> = ParameterMap::mapped_type(it-&gt;second).boolValue();
    }
    <span class="keywordflow">else</span> {
        <a class="code" href="a00039.html#aa9f8dbeb8e7e0f3a9200652d1f81a88c" title="Whether debug messages should be displayed.">debug</a> = <span class="keyword">false</span>;
    }
    <span class="keywordflow">if</span> ((it = params.find(<span class="stringliteral">&quot;carrierFrequency&quot;</span>)) != params.end()) {
        <a class="code" href="a00039.html#a15f631e677b586706c16f910187c5b69" title="Carrier frequency in Hz.">carrierFrequency</a> = ParameterMap::mapped_type(it-&gt;second).doubleValue();
    }
    <span class="keywordflow">else</span> {
        bInitSuccess = <span class="keyword">false</span>;
        opp_warning(<span class="stringliteral">&quot;No carrierFrequency defined in config.xml for SimplePathlossModel!&quot;</span>);
    }

    <span class="keywordflow">return</span> <a class="code" href="a00039.html#ad3082c9473bc2e4f973b565268f37ce0" title="Initialize the analog model from XML map data.">AnalogueModel::initFromMap</a>(params) &amp;&amp; bInitSuccess;
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a0c6ce678120579025519343c8a0974c3"></a><!-- doxytag: member="BreakpointPathlossModel::pathlosses" ref="a0c6ce678120579025519343c8a0974c3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cOutVector <a class="el" href="a00039.html#a0c6ce678120579025519343c8a0974c3">BreakpointPathlossModel::pathlosses</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>logs computed pathlosses. </p>

<p>Referenced by <a class="el" href="a00039.html#a6e8f40d451a398c981c5039da397b4db">filterSignal()</a>.</p>

</div>
</div>
<a class="anchor" id="aaf5084c5a5dc83b37a468e5813a8191d"></a><!-- doxytag: member="BreakpointPathlossModel::PL01" ref="aaf5084c5a5dc83b37a468e5813a8191d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="a00039.html#aaf5084c5a5dc83b37a468e5813a8191d">BreakpointPathlossModel::PL01</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Model to use for distances below breakpoint distance. </p>
<p>Model to use for distances larger than the breakpoint distance initial path loss in dB </p>

<p>Referenced by <a class="el" href="a00039.html#ad3082c9473bc2e4f973b565268f37ce0">initFromMap()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/analogueModel/<a class="el" href="a00395_source.html">BreakpointPathlossModel.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/analogueModel/BreakpointPathlossModel.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00039.html">BreakpointPathlossModel</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:31 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
